package Expe7;


import java.util.Scanner;

/**
 * @Author sy
 * @Date 2022/10/4
 */
public class T2 {
    public static void main(String[] args) {
        Dex d = new Dex();
        Scanner in = new Scanner(System.in);
        System.out.println("请输入长：");
        d.length=in.nextDouble();

        System.out.println("请输入宽：");
        d.width=in.nextDouble();

        Cuboid c = new Cuboid();
        c.setBottom(d);
        System.out.println("请输入高：");
        c.setHeight(in.nextDouble());

        System.out.println("该长方体的体积为："+c.getV());
    }
}
class Dex{
    double length;
    double width;
    double getArea(){
        double area = length*width;
        return area;
    }
}
class Cuboid{
    Dex bottom;
    double height;
    void setBottom(Dex d){
        bottom = d;
    }
    void setHeight(double h){
        height=h;
    }
    double getV(){
        return bottom.getArea()*height;
    }
}
